#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<bitset>
#include<map>
#include<queue>
using namespace std;
vector<int>ans;
const int N = 1e5 + 10, M = N * 2;
map<int, int>mp;
int a[N];
vector<int>ans;
int d[N];
int b[N];
int n;
int h[N], e[M], ne[M], idx, w[M];
void add(int a, int b)
{
	e[idx] = b, ne[idx] = h[a], h[a] = idx++;
}
void tuopu()
{
	queue<int>q;
	for (int i = 1; i <= n; i++) {
		if (!d[i]) {
			q.push(i);
		}
	}
	int cnt = 0;
	while (q.size()) {
		int t = q.front();
		q.pop();
		ans[++cnt] = t;
		for (int i = h[t]; ~i; i = ne[i]) {
			int j = e[i];
			if (--d[j] == 0) {
				q.push(j);
			}
		}
	}
}
int main()
{
	int t;
	cin >> t;
	while (t--) {
		cin >> n;
		for (int i = 1; i <= n; i++) {
			cin >> a[i];
		}
		for (int i = 1; i <= n; i++) {
			cin >> b[i];
			mp[i] = a[i] - b[i];
		}
		for (int i = 1; i <= n; i++) {
			for (auto x : mp) {
				if (x.first != i) {
					if (mp[i] > x.second) {
						add(i, x.first);
						d[x.first]++;
					}
				}
			}
		}
		tuopu();
		bitset<N>f[N];
		int cnt = 0;
		vector<int>ans1;
		for (int i = n; i >= 1; i--) {
			f[i][i] = 1;
			for (int j = h[i]; ~j; j = ne[j]) {
				int k = e[j];
				f[i] |= f[j];
			}
			if (f[i].count() == n) {
				cnt++;
				ans1.push_back(i);
			}
		}
		cout << cnt << endl;
		for (int x : ans) {
			cout << x << " ";
		}
		cout << endl;
	}
	return 0;
}